Considering and Ignoring Statements
Considering statements allow you to control the way AppleScript executes operations and commands by listing specific characteristics, called attributes,
to be taken into account as the operations and commands are executed. Ignoring statements work the same way, except that you list specific attributes to be ignored.The attributes you can use include
Here's an example of a string comparison without a Considering statement:
- case, white space, and others that affect string comparisons
- an attribute called
application responses
that controls whether or not AppleScript waits for responses from commands sent to applications
"This" = "this"--result: trueThe value of the string comparison istrue
, because by default, AppleScript does not distinguish uppercase from lowercase letters.Here's an example of the same comparison within a Considering statement:
considering case "This" = "this"end considering --result: falseThe Considering statement specifies that a particular attribute of strings-their case--is to be used in comparisons. As a result the comparison"This" = "this"
is nowfalse
, because the uppercase "T" in"This"
does not match the lowercase "t" in"this"
.